
def _mark_str( line, chars = set(""".(),""")):
    target_list = []
    for i in line:
        if i in chars:
            target_list.append(' ')
        else:
            target_list.append(i)
    return ''.join(target_list).split()


def statistics(filename,log_list=None):
    if log_list is None :
        log_list = []
    with open(filename,encoding='utf8') as f :
        for line in f:
            log_list += _mark_str(line)  # 替换特殊符号
    return log_list
l = statistics('work_file.txt')
print(len(l))  # 105

# 特殊符号考虑的不够，例如! ? / 等等，都没有考虑到。

